import { useSelector } from "react-redux"

import { UserState } from "@/interface/user/user"

export const usePermission = (authId: string | number): boolean =>
	useSelector((state: { user: UserState }) => state.user?.permissions ?? []).includes(authId.toString())
